package com.aiti.lulian.controller.crad;


import com.aiti.base.core.base.controller.WebController;
import com.aiti.base.core.utils.message.Message;
import com.aiti.lulian.service.CardQuoteShareService;
import com.aiti.lulian.vo.CardQuoteShareVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/card/quote")
public class CardQuoteShareController extends WebController {

    @Autowired
    private final CardQuoteShareService cardQuoteShareService;

    public CardQuoteShareController(CardQuoteShareService cardQuoteShareService) {
        this.cardQuoteShareService = cardQuoteShareService;
    }

    /**
     * 报价单分享
     * @param vo
     * @return
     */

    @GetMapping("/share")
    public Message share(CardQuoteShareVo vo){
//        String userId = findUserId();
//        vo.setSenderId(userId);
        return cardQuoteShareService.share(vo);
    }

    /**
     * 报价单接收
     * @param vo
     * @return
     */
    @GetMapping("/receive")
    public Message receive(CardQuoteShareVo vo){
        //String userId = findUserId();
        //vo.setReceiverId(userId);
        return cardQuoteShareService.receive(vo);
    }


}
